#include <iostream> 
#include <string>
#include <stack> 
#include <map>
using namespace std;

double value(const string &s){
	map<string,double> mp = {{"10",10},{"A",1},{"J",11},{"Q",12},{"K",13}};
	if( s.length()==1 && s[0]>='2' && s[0] <='9') return s[0]-'0';
	else return mp[s];
} 
bool f(const string a[],int ly,char opr[]){
	if( ly==4 ){
		stack<double> num;
		stack<char> op;
		num.push(value(a[0]));
		for(int i=0; i<3; i++){
			while( !op.empty() &&( opr[i]=='+' || opr[i]=='-'
				|| op.top()=='*'||op.top()=='/' )){
				double t2 = num.top();num.pop();
				double t1 = num.top();num.pop();
				switch(op.top()){
					case '+': num.push( t1+t2 );break;
					case '-': num.push( t1-t2 );break;
					case '*': num.push( t1*t2 );break;
					case '/': num.push( t1/t2 );break;
				} 
				op.pop();
			}
			op.push(opr[i]);
			num.push(value(a[i+1]));
		}
		while( !op.empty() ){
			double t2 = num.top();num.pop();
			double t1 = num.top();num.pop();
			switch(op.top()){
				case '+': num.push( t1+t2 );break;
				case '-': num.push( t1-t2 );break;
				case '*': num.push( t1*t2 );break;
				case '/': num.push( t1/t2 );break;
			} 
			op.pop();
		}
		if( num.top()==24 ) return true;
		else return false;
	}
	string s = "+-*/";
	for(int i=0; i<4; i++){
		opr[ly] = s[i];
		if( f(a,ly+1,opr) ) return true;
	}
	return false;
}
double ffff(string a[],char opr[]){
		stack<double> num;
		stack<char> op;
		num.push(value(a[0]));
		for(int i=0; i<3; i++){
			while( !op.empty() &&( opr[i]=='+' || opr[i]=='-'
				|| op.top()=='*'||op.top()=='/' )){
				double t2 = num.top();num.pop();
				double t1 = num.top();num.pop();
				switch(op.top()){
					case '+': num.push( t1+t2 );break;
					case '-': num.push( t1-t2 );break;
					case '*': num.push( t1*t2 );break;
					case '/': num.push( t1/t2 );break;
				} 
				op.pop();
			}
			op.push(opr[i]);
			num.push(value(a[i+1]));
		}
		while( !op.empty() ){
			double t2 = num.top();num.pop();
			double t1 = num.top();num.pop();
			switch(op.top()){
				case '+': num.push( t1+t2 );break;
				case '-': num.push( t1-t2 );break;
				case '*': num.push( t1*t2 );break;
				case '/': num.push( t1/t2 );break;
			} 
			op.pop();
		}
		return num.top();
}
int main(){
	string aa[4] = {"10","2","3","4"};
	char oprr[4] = "++*";
	cout << ffff(aa,oprr);
	string a[4];
	for(int i=0; i<4; i++){
		cin >> a[i];
		if( a[i]=="joker"||a[i]=="JOKER"){
			cout << "ERROR";
			return 0;
		}
	}
	char opr[4];
	if( f(a,0,opr) ){
		for(int i=0; i<3; i++)
			cout << a[i] << opr[i];
		cout << a[3];
	}else cout << "NONE";
	return 0;
}
